<include file="Common:minheader" />
<!-- /. NAV SIDE  -->
<form class="layui-form" action="">
	<input type="hidden" name="p_region_id" value="3182"><!--宁波-->
	<input type="hidden" name="region_grade" value="3">
	<div class="layui-form-item">
		<label class="layui-form-label">地区名称</label>
		<div class="layui-input-block">
		  <input type="text" name="local_name" required  lay-verify="required" placeholder="请输入客户来源名称" autocomplete="off" class="layui-input">
		</div>
	</div>
	<div class="layui-form-item">
		<label class="layui-form-label">是否启用</label>
		<div class="layui-input-block">
		  <input type="radio" name="status" value="1" title="是" checked>
		  <input type="radio" name="status" value="0" title="否">
		</div>
	</div>
	<div class="layui-form-item">
		<div class="layui-input-block">
		  <button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
		  <button type="reset" class="layui-btn layui-btn-primary">重置</button>
		</div>
  </div>
</form>
<script>
	//Demo
	layui.use('form', function(){
	  var form = layui.form;
	  //监听提交
	  form.on('submit(formDemo)', function(data){
			var cont = data.field;
			$.ajax({
				url:"{:U('Configure/addAddress')}",
				type:'post',
				dataType:'json',
				data:cont,
				success:function(data){
					if(data.code==0){
						layer.alert(data.message);
					}else{
						layer.alert(data.message, function(index){
							//do something
							window.parent.location.reload();
							var index = parent.layer.getFrameIndex(window.name); 
							parent.layer.close(index);
						});
					}
				}
			});
			//layer.msg(JSON.stringify(data.field));
			return false;
	  });
	});
</script>
<!-- /. PAGE INNER  -->
<include file="Common:footer" />